package AmazingMaze;

public class Character {
    private int hp;
    private Plate place;
    private int step;
    private Frame frame;

    public Character(Plate place, Frame frame) {
        this.place = place;
        this.frame = frame;
        place.setChar(this);
    }

    public void go(int dir) {
        step++;
        place.setVisible(dir, true);
        if (!place.isWall(dir)) {
            place.CharOut();
            if (place.get(dir).isCharHere()) {
                frame.onGrabGold(step);
            }
            this.place = place.get(dir);
            place.setChar(this);
        }
    }

    public void setStep(int step) {
        this.step = step;
    }

    public void setPlace(Plate pl) {
        this.place = pl;
    }
}